/**
 * 
 */
package com.gwcloud.leetcode.offers;

import com.gwcloud.leetcode.common.datastructure.ListNode;

/**
 * @ClassName   : Leetcode0240 
 * @author      : ganwei 
 * @date        : 2020年6月2日
 * @Description : 面试题24. 反转链表
 */
public class Leetcode0240 {
    public ListNode reverseList(ListNode head) {
    	if(head == null || head.next == null){
    		return head;
    	}
    	ListNode node = reverseList(head.next);
    	head.next.next = head;
    	head.next = null;
    	return node;
    }
}
